package com.mepo.cheer.server;

import java.util.ArrayList;
import java.util.List;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.mepo.cheer.client.DataService;
import com.mepo.cheer.shared.Coach;
import com.mepo.cheer.shared.MepoMenuType;
import com.mepo.cheer.shared.Photos;
import com.mepo.cheer.shared.Squad;

/**
 * The server side implementation of the RPC service.
 */
public class DataServiceImpl extends RemoteServiceServlet implements DataService {

	private static final long serialVersionUID = 1L;

	@Override
	public List<List<MepoMenuType>> getMenuItems() {		
		//squads
		Squad football = new Squad();
		football.setMenuText("Football");
		football.setMenuCategory("Squad");
		football.setHeader("Football");
		football.setImageLocation("images/cheer.jpg");
		football.setImageDesc("Image Description");
		
		Squad basketball = new Squad();
		basketball.setMenuCategory("Squad");
		basketball.setMenuText("Basketball");
		basketball.setHeader("Basketball");
		basketball.setImageLocation("images/cheer.jpg");
		basketball.setImageDesc("Image Description");
		
		Squad wrestling = new Squad();
		wrestling.setMenuCategory("Squad");
		wrestling.setMenuText("Wrestling");
		wrestling.setHeader("Wrestling");
		wrestling.setImageLocation("images/cheer.jpg");
		wrestling.setImageDesc("Image Description");
		
		Squad competition = new Squad();
		competition.setMenuCategory("Squad");
		competition.setMenuText("Competition");
		competition.setHeader("Competition");
		competition.setImageLocation("images/cheer.jpg");
		competition.setImageDesc("Image Description");
		
		List<MepoMenuType> squads = new ArrayList<MepoMenuType>();
		squads.add(football);
		squads.add(basketball);
		squads.add(wrestling);
		squads.add(competition);
		
		//media
		Photos photos = new Photos();
		photos.setMenuCategory("Media");
		photos.setMenuText("Photos");
		photos.setHeader("Photos");
		photos.addPhotoSet("All", "<object width=\"700\" height=\"525\"> <param name=\"flashvars\" value=\"offsite=true&lang=en-us&page_show_url=%2Fphotos%2F72637626%40N08%2Fshow%2F&page_show_back_url=%2Fphotos%2F72637626%40N08%2F&user_id=72637626@N08&jump_to=\"></param> <param name=\"movie\" value=\"http://www.flickr.com/apps/slideshow/show.swf?v=109615\"></param> <param name=\"allowFullScreen\" value=\"true\"></param><embed type=\"application/x-shockwave-flash\" src=\"http://www.flickr.com/apps/slideshow/show.swf?v=109615\" allowFullScreen=\"true\" flashvars=\"offsite=true&lang=en-us&page_show_url=%2Fphotos%2F72637626%40N08%2Fshow%2F&page_show_back_url=%2Fphotos%2F72637626%40N08%2F&user_id=72637626@N08&jump_to=\" width=\"700\" height=\"525\"></embed></object>");
		photos.addPhotoSet("Football", "<object width=\"700\" height=\"525\"> <param name=\"flashvars\" value=\"offsite=true&lang=en-us&page_show_url=%2Fphotos%2F72637626%40N08%2Fsets%2F72157628514565443%2Fshow%2F&page_show_back_url=%2Fphotos%2F72637626%40N08%2Fsets%2F72157628514565443%2F&set_id=72157628514565443&jump_to=\"></param> <param name=\"movie\" value=\"http://www.flickr.com/apps/slideshow/show.swf?v=109615\"></param> <param name=\"allowFullScreen\" value=\"true\"></param><embed type=\"application/x-shockwave-flash\" src=\"http://www.flickr.com/apps/slideshow/show.swf?v=109615\" allowFullScreen=\"true\" flashvars=\"offsite=true&lang=en-us&page_show_url=%2Fphotos%2F72637626%40N08%2Fsets%2F72157628514565443%2Fshow%2F&page_show_back_url=%2Fphotos%2F72637626%40N08%2Fsets%2F72157628514565443%2F&set_id=72157628514565443&jump_to=\" width=\"700\" height=\"525\"></embed></object>");
		
		
				
		List<MepoMenuType> media = new ArrayList<MepoMenuType>();
		media.add(photos);
		
		//coaches
		Coach c = new Coach();
		c.setMenuCategory("Coaches");
		c.setMenuText("Cassie");
		c.setName("Cassie");
		c.setBio("Here is Cassie's Bio!");
		c.setImageLocation("images/cheer.jpg");
		
		Coach r = new Coach();
		r.setMenuCategory("Coaches");
		r.setMenuText("Reagan");
		r.setName("Reagan");
		r.setBio("Here is Reagan's Bio!");
		r.setImageLocation("images/cheer.jpg");
		
		List<MepoMenuType> coaches = new ArrayList<MepoMenuType>();
		coaches.add(c);
		coaches.add(r);
		
		//add submenus to menu
		List<List<MepoMenuType>> menuItems = new ArrayList<List<MepoMenuType>>();
		menuItems.add(squads);
		menuItems.add(media);
		menuItems.add(coaches);
		
		return menuItems;
	}

}
